import request from '@/router/axios';
/**
 *
 * 维修执行接口大全
 */
export const getList = (params) => {
    return request({
        url: '/api/mes-product/mro/centerproduct/repair-list',
        method: 'get',
        params
    });
};


export const getBomDetail = (params) => {
    return request({
        url: '/api/mes-admin/bom/info-by-partno-and-positionno',
        method: 'get',
        params
    });
}


// 维修结束
export const repairEnd = (data) => {
    return request({
        url: '/api/mes-product/mro-repair-execute/execute',
        method: 'post',
        data
    });
};

// 获取维修代码，不良配置等列表的集合
export const getMrodictList = (params) => {
    return request({
        url: '/api/mes-product/mro/dict/list',
        method: 'get',
        params: {
            ...params
        }
    });
};

/**
 * 标记报废
 */
export const flagScrap = (data) => {
    return request({
        url: `/api/mes-product/mro/centerproduct/repair-scrap`,
        method: 'post',
        data
    });
};


export const getSequenceNumber = (params) => {
    return request({
        url: '/api/mes-warehouse/packing-material/getVO-by-sn',
        method: 'get',
        params
    });
};

export const positionNo = (params) => {
    return request({
        url: '/api/mes-admin/bom/info-by-partno',
        method: 'get',
        params
    });
};

export const getSn = (params) => {
    return request({
        url: '/api/mes-product/product/check-sequence-number',
        method: 'get',
        params
    });
};


export const uploadFile = (data) => {
    return request({
        url: '/api/blade-resource/oss/endpoint/put-file-attach',
        method: 'post',
        headers: { 'Content-Type': 'multipart/form-data' },
        data
    });
}

export const getFailureType = (params) => {
    return request({
        url: '/api/mes-product/mro/dict/list?dictType=FAILURETYPE',
        method: 'get',
        params
    });
};

/**
 * 序列号详情
 */
export const getSnDetail = (params) => {
    return request({
        url: '/api/mes-product/mro-repair-confirm/detail',
        method: 'get',
        params
    });
};

/**
 * 根据工单获取工序信息
 */
export const getWorkOrderRoute = (params) => {
    return request({
        url: '/api/mes-product/process/product-route/workorder-routes',
        method: 'get',
        params
    });
};

// 维修执行无需确认
export const repairExec = (data) => {
    return request({
        url: '/api/mes-product/mro-repair-execute/execute-and-out',
        method: 'post',
        data
    });
};





